<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha256-CTSx/A06dm1B063156EVh15m6Y67pAjZZaQc89LLSrU=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.24/fancybox/fancybox.css" integrity="sha256-vQkngPS8jiHHH0I6ABTZroZk8NPZ7b+MUReOFE9UsXQ=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"rjyblog.gitee.io","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.18.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":null},"fold":{"enable":false,"height":500},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta property="og:type" content="website">
<meta property="og:title" content="任建勇的博客">
<meta property="og:url" content="https://rjyblog.gitee.io/page/5/index.html">
<meta property="og:site_name" content="任建勇的博客">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Jason">
<meta property="article:tag" content="Android, Java, Kotlin, Flutter, 前端技术, 设计模式">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://rjyblog.gitee.io/page/5/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"page/5/index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>任建勇的博客</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">任建勇的博客</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Jason"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">Jason</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">66</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">13</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/60405.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/60405.html" class="post-title-link" itemprop="url">Android应用进程启动流程</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-29 14:04:48" itemprop="dateCreated datePublished" datetime="2020-11-29T14:04:48+08:00">2020-11-29</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-18 15:56:33" itemprop="dateModified" datetime="2023-10-18T15:56:33+08:00">2023-10-18</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">本文介绍Android应用进程的启动流程。从一个应用的Activity中（比如luncher），启动</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>本文基于Android8.0源码。</p>
<h2 id="启动流程图"><a href="#启动流程图" class="headerlink" title="启动流程图"></a>启动流程图</h2><p>点击可以看大图</p>
<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" height="2035px" preserveAspectRatio="none" style="width:2278px;height:2035px;background:#FFFFFF;" version="1.1" viewBox="0 0 2278 2035" width="2278px" zoomAndPan="magnify"><defs/><g><rect fill="#FFFFFF" height="169.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="152" y="1770.0625"/><rect fill="#FFFFFF" height="936.5156" style="stroke:#181818;stroke-width:1.0;" width="10" x="345" y="351.6563"/><rect fill="#FFFFFF" height="878.25" style="stroke:#181818;stroke-width:1.0;" width="10" x="543" y="380.7891"/><rect fill="#FFFFFF" height="841.1172" style="stroke:#181818;stroke-width:1.0;" width="10" x="548" y="417.9219"/><rect fill="#FFFFFF" height="432.5234" style="stroke:#181818;stroke-width:1.0;" width="10" x="553" y="502.1875"/><rect fill="#FFFFFF" height="280.1953" style="stroke:#181818;stroke-width:1.0;" width="10" x="553" y="978.8438"/><rect fill="#FFFFFF" height="378.3906" style="stroke:#181818;stroke-width:1.0;" width="10" x="765" y="536.3203"/><rect fill="#FFFFFF" height="236.6953" style="stroke:#181818;stroke-width:1.0;" width="10" x="948" y="648.8828"/><rect fill="#FFFFFF" height="338.2266" style="stroke:#181818;stroke-width:1.0;" width="10" x="1069" y="1652.5"/><rect fill="#FFFFFF" height="203.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="1074" y="1735.9297"/><rect fill="#FFFFFF" height="631.2891" style="stroke:#181818;stroke-width:1.0;" width="10" x="1392.5" y="1359.4375"/><rect fill="#FFFFFF" height="883.25" style="stroke:#181818;stroke-width:1.0;" width="10" x="1550.5" y="246.2578"/><rect fill="#FFFFFF" height="193.5625" style="stroke:#181818;stroke-width:1.0;" width="10" x="1555.5" y="678.0156"/><rect fill="#FFFFFF" height="135.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="1560.5" y="715.1484"/><rect fill="#FFFFFF" height="66.2969" style="stroke:#181818;stroke-width:1.0;" width="10" x="1565.5" y="757.2813"/><rect fill="#FFFFFF" height="158.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="1725.5" y="1071.2422"/><rect fill="#FFFFFF" height="63.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="1730.5" y="1166.6406"/><rect fill="#FFFFFF" height="665.4219" style="stroke:#181818;stroke-width:1.0;" width="10" x="1725.5" y="1325.3047"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1925.5" y="1100.375"/><rect fill="#FFFFFF" height="113.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="2018" y="1430.7031"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="157" x2="157" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="349.5" x2="349.5" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="547.5" x2="547.5" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="770" x2="770" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="953" x2="953" y1="574.9688" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1074" x2="1074" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1268.5" x2="1268.5" y1="1696.1484" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1397.5" x2="1397.5" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1555" x2="1555" y1="106.0781" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1730" x2="1730" y1="800.9297" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1930.5" x2="1930.5" y1="36.2969" y2="1999.7266"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="2022.5" x2="2022.5" y1="36.2969" y2="1999.7266"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="184" x="65" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="170" x="72" y="24.9951">ActivityManagerService</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="184" x="65" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="170" x="72" y="2018.7217">ActivityManagerService</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="69" x="315.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55" x="322.5" y="24.9951">Process</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="69" x="315.5" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="55" x="322.5" y="2018.7217">Process</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="121" x="487.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="494.5" y="24.9951">ZygoteProcess</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="121" x="487.5" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="107" x="494.5" y="2018.7217">ZygoteProcess</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="106" x="717" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="92" x="724" y="24.9951">ZygoteState</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="106" x="717" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="92" x="724" y="2018.7217">ZygoteState</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="102" x="902" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="88" x="909" y="2018.7217">LocalSocket</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="120" x="1014" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="1021" y="24.9951">ActivityThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="120" x="1014" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="106" x="1021" y="2018.7217">ActivityThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="147" x="1195.5" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="133" x="1202.5" y="2018.7217">ApplicationThread</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="90" x="1352.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="76" x="1359.5" y="24.9951">ZygoteInit</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="90" x="1352.5" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="76" x="1359.5" y="2018.7217">ZygoteInit</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="113" x="1499" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99" x="1506" y="2018.7217">ZygoteServer</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="149" x="1656" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="135" x="1663" y="2018.7217">ZygoteConnection</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="66" x="1897.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="1904.5" y="24.9951">Zygote</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="66" x="1897.5" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="52" x="1904.5" y="2018.7217">Zygote</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="99" x="1973.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85" x="1980.5" y="24.9951">RuntimeInit</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="99" x="1973.5" y="1998.7266"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85" x="1980.5" y="2018.7217">RuntimeInit</text><rect fill="#FFFFFF" height="169.5313" style="stroke:#181818;stroke-width:1.0;" width="10" x="152" y="1770.0625"/><rect fill="#FFFFFF" height="936.5156" style="stroke:#181818;stroke-width:1.0;" width="10" x="345" y="351.6563"/><rect fill="#FFFFFF" height="878.25" style="stroke:#181818;stroke-width:1.0;" width="10" x="543" y="380.7891"/><rect fill="#FFFFFF" height="841.1172" style="stroke:#181818;stroke-width:1.0;" width="10" x="548" y="417.9219"/><rect fill="#FFFFFF" height="432.5234" style="stroke:#181818;stroke-width:1.0;" width="10" x="553" y="502.1875"/><rect fill="#FFFFFF" height="280.1953" style="stroke:#181818;stroke-width:1.0;" width="10" x="553" y="978.8438"/><rect fill="#FFFFFF" height="378.3906" style="stroke:#181818;stroke-width:1.0;" width="10" x="765" y="536.3203"/><rect fill="#FFFFFF" height="236.6953" style="stroke:#181818;stroke-width:1.0;" width="10" x="948" y="648.8828"/><rect fill="#FFFFFF" height="338.2266" style="stroke:#181818;stroke-width:1.0;" width="10" x="1069" y="1652.5"/><rect fill="#FFFFFF" height="203.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="1074" y="1735.9297"/><rect fill="#FFFFFF" height="631.2891" style="stroke:#181818;stroke-width:1.0;" width="10" x="1392.5" y="1359.4375"/><rect fill="#FFFFFF" height="883.25" style="stroke:#181818;stroke-width:1.0;" width="10" x="1550.5" y="246.2578"/><rect fill="#FFFFFF" height="193.5625" style="stroke:#181818;stroke-width:1.0;" width="10" x="1555.5" y="678.0156"/><rect fill="#FFFFFF" height="135.4297" style="stroke:#181818;stroke-width:1.0;" width="10" x="1560.5" y="715.1484"/><rect fill="#FFFFFF" height="66.2969" style="stroke:#181818;stroke-width:1.0;" width="10" x="1565.5" y="757.2813"/><rect fill="#FFFFFF" height="158.6641" style="stroke:#181818;stroke-width:1.0;" width="10" x="1725.5" y="1071.2422"/><rect fill="#FFFFFF" height="63.2656" style="stroke:#181818;stroke-width:1.0;" width="10" x="1730.5" y="1166.6406"/><rect fill="#FFFFFF" height="665.4219" style="stroke:#181818;stroke-width:1.0;" width="10" x="1725.5" y="1325.3047"/><rect fill="#FFFFFF" height="29.1328" style="stroke:#181818;stroke-width:1.0;" width="10" x="1925.5" y="1100.375"/><rect fill="#FFFFFF" height="113.3984" style="stroke:#181818;stroke-width:1.0;" width="10" x="2018" y="1430.7031"/><ellipse cx="7.5" cy="66.6797" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="1385.5,63.4297,1395.5,67.4297,1385.5,71.4297,1389.5,67.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="1391.5" y1="67.4297" y2="67.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="32" x="15" y="62.3638">main</text><polygon fill="#181818" points="1487,77.4297,1497,81.4297,1487,85.4297,1491,81.4297" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1397.5" x2="1493" y1="81.4297" y2="81.4297"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="113" x="1499" y="75.4297"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99" x="1506" y="95.4248">ZygoteServer</text><polygon fill="#181818" points="1543.5,133.8594,1553.5,137.8594,1543.5,141.8594,1547.5,137.8594" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1397.5" x2="1549.5" y1="137.8594" y2="137.8594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="134" x="1404.5" y="132.7935">registerServerSocket</text><line style="stroke:#181818;stroke-width:1.0;" x1="1555.5" x2="1597.5" y1="166.9922" y2="166.9922"/><line style="stroke:#181818;stroke-width:1.0;" x1="1597.5" x2="1597.5" y1="166.9922" y2="179.9922"/><line style="stroke:#181818;stroke-width:1.0;" x1="1556.5" x2="1597.5" y1="179.9922" y2="179.9922"/><polygon fill="#181818" points="1566.5,175.9922,1556.5,179.9922,1566.5,183.9922,1562.5,179.9922" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="159" x="1562.5" y="161.9263">new LocalServerSocket()</text><polygon fill="#181818" points="1543.5,205.125,1553.5,209.125,1543.5,213.125,1547.5,209.125" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1397.5" x2="1549.5" y1="209.125" y2="209.125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="1404.5" y="204.0591">runSelectLoop</text><line style="stroke:#181818;stroke-width:1.0;" x1="1555.5" x2="1602.5" y1="233.2578" y2="233.2578"/><line style="stroke:#181818;stroke-width:1.0;" x1="1602.5" x2="1602.5" y1="233.2578" y2="246.2578"/><line style="stroke:#181818;stroke-width:1.0;" x1="1561.5" x2="1602.5" y1="246.2578" y2="246.2578"/><polygon fill="#181818" points="1571.5,242.2578,1561.5,246.2578,1571.5,250.2578,1567.5,246.2578" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="69" x="1567.5" y="228.1919">while(true)</text><line style="stroke:#181818;stroke-width:1.0;" x1="1560.5" x2="1602.5" y1="280.3906" y2="280.3906"/><line style="stroke:#181818;stroke-width:1.0;" x1="1602.5" x2="1602.5" y1="280.3906" y2="293.3906"/><line style="stroke:#181818;stroke-width:1.0;" x1="1561.5" x2="1602.5" y1="293.3906" y2="293.3906"/><polygon fill="#181818" points="1571.5,289.3906,1561.5,293.3906,1571.5,297.3906,1567.5,293.3906" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="53" x="1567.5" y="275.3247">Os.poll()</text><ellipse cx="7.5" cy="321.7734" fill="none" rx="4" ry="4" style="stroke:#181818;stroke-width:1.5;"/><polygon fill="#181818" points="145,318.5234,155,322.5234,145,326.5234,149,322.5234" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="12" x2="151" y1="322.5234" y2="322.5234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="125" x="15" y="317.4575">startProcessLocked</text><polygon fill="#181818" points="333,347.6563,343,351.6563,333,355.6563,337,351.6563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="157" x2="339" y1="351.6563" y2="351.6563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="164" y="346.5903">start</text><polygon fill="#181818" points="531,376.7891,541,380.7891,531,384.7891,535,380.7891" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="355" x2="537" y1="380.7891" y2="380.7891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="30" x="362" y="375.7231">start</text><line style="stroke:#181818;stroke-width:1.0;" x1="553" x2="600" y1="404.9219" y2="404.9219"/><line style="stroke:#181818;stroke-width:1.0;" x1="600" x2="600" y1="404.9219" y2="417.9219"/><line style="stroke:#181818;stroke-width:1.0;" x1="559" x2="600" y1="417.9219" y2="417.9219"/><polygon fill="#181818" points="569,413.9219,559,417.9219,569,421.9219,565,417.9219" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="97" x="565" y="399.856">startViaZygote</text><line style="stroke:#181818;stroke-width:1.0;" x1="558" x2="600" y1="452.0547" y2="452.0547"/><line style="stroke:#181818;stroke-width:1.0;" x1="600" x2="600" y1="452.0547" y2="465.0547"/><line style="stroke:#181818;stroke-width:1.0;" x1="559" x2="600" y1="465.0547" y2="465.0547"/><polygon fill="#181818" points="569,461.0547,559,465.0547,569,469.0547,565,465.0547" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="96" x="565" y="446.9888">&#32452;&#35013;zygote&#21442;&#25968;</text><line style="stroke:#181818;stroke-width:1.0;" x1="558" x2="605" y1="489.1875" y2="489.1875"/><line style="stroke:#181818;stroke-width:1.0;" x1="605" x2="605" y1="489.1875" y2="502.1875"/><line style="stroke:#181818;stroke-width:1.0;" x1="564" x2="605" y1="502.1875" y2="502.1875"/><polygon fill="#181818" points="574,498.1875,564,502.1875,574,506.1875,570,502.1875" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="179" x="570" y="484.1216">openZygoteSocketIfNeeded</text><polygon fill="#181818" points="753,532.3203,763,536.3203,753,540.3203,757,536.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="563" x2="759" y1="536.3203" y2="536.3203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="570" y="531.2544">connect</text><polygon fill="#181818" points="890,546.3203,900,550.3203,890,554.3203,894,550.3203" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="775" x2="896" y1="550.3203" y2="550.3203"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="102" x="902" y="544.3203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="88" x="909" y="564.3154">LocalSocket</text><line style="stroke:#181818;stroke-width:1.0;" x1="775" x2="817" y1="606.75" y2="606.75"/><line style="stroke:#181818;stroke-width:1.0;" x1="817" x2="817" y1="606.75" y2="619.75"/><line style="stroke:#181818;stroke-width:1.0;" x1="776" x2="817" y1="619.75" y2="619.75"/><polygon fill="#181818" points="786,615.75,776,619.75,786,623.75,782,619.75" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="159" x="782" y="601.6841">new LocalSocketAddress</text><polygon fill="#181818" points="936,644.8828,946,648.8828,936,652.8828,940,648.8828" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="775" x2="942" y1="648.8828" y2="648.8828"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="782" y="643.8169">connect</text><polygon fill="#181818" points="1543.5,674.0156,1553.5,678.0156,1543.5,682.0156,1547.5,678.0156" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="958" x2="1549.5" y1="678.0156" y2="678.0156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="51" x="965" y="672.9497">connect</text><line style="stroke:#181818;stroke-width:1.0;" x1="1565.5" x2="1612.5" y1="702.1484" y2="702.1484"/><line style="stroke:#181818;stroke-width:1.0;" x1="1612.5" x2="1612.5" y1="702.1484" y2="715.1484"/><line style="stroke:#181818;stroke-width:1.0;" x1="1571.5" x2="1612.5" y1="715.1484" y2="715.1484"/><polygon fill="#181818" points="1581.5,711.1484,1571.5,715.1484,1581.5,719.1484,1577.5,715.1484" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="139" x="1577.5" y="697.0825">acceptCommandPeer</text><line style="stroke:#181818;stroke-width:1.0;" x1="1570.5" x2="1617.5" y1="744.2813" y2="744.2813"/><line style="stroke:#181818;stroke-width:1.0;" x1="1617.5" x2="1617.5" y1="744.2813" y2="757.2813"/><line style="stroke:#181818;stroke-width:1.0;" x1="1576.5" x2="1617.5" y1="757.2813" y2="757.2813"/><polygon fill="#181818" points="1586.5,753.2813,1576.5,757.2813,1586.5,761.2813,1582.5,757.2813" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="141" x="1582.5" y="739.2153">createNewConnection</text><polygon fill="#181818" points="1644,772.2813,1654,776.2813,1644,780.2813,1648,776.2813" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1575.5" x2="1650" y1="776.2813" y2="776.2813"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="149" x="1656" y="770.2813"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="135" x="1663" y="790.2764">ZygoteConnection</text><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1575.5" x2="1617.5" y1="822.5781" y2="822.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1617.5" x2="1617.5" y1="822.5781" y2="835.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1570.5" x2="1617.5" y1="835.5781" y2="835.5781"/><polygon fill="#181818" points="1580.5,831.5781,1570.5,835.5781,1580.5,839.5781,1576.5,835.5781" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1570.5" x2="1612.5" y1="849.5781" y2="849.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1612.5" x2="1612.5" y1="849.5781" y2="862.5781"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1565.5" x2="1612.5" y1="862.5781" y2="862.5781"/><polygon fill="#181818" points="1575.5,858.5781,1565.5,862.5781,1575.5,866.5781,1571.5,862.5781" style="stroke:#181818;stroke-width:1.0;"/><polygon fill="#181818" points="969,867.5781,959,871.5781,969,875.5781,965,871.5781" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="963" x2="1549.5" y1="871.5781" y2="871.5781"/><polygon fill="#181818" points="786,881.5781,776,885.5781,786,889.5781,782,885.5781" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="780" x2="952" y1="885.5781" y2="885.5781"/><polygon fill="#181818" points="574,910.7109,564,914.7109,574,918.7109,570,914.7109" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="568" x2="769" y1="914.7109" y2="914.7109"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="580" y="909.645">ZygoteState</text><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="563" x2="605" y1="933.7109" y2="933.7109"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="605" x2="605" y1="933.7109" y2="946.7109"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="558" x2="605" y1="946.7109" y2="946.7109"/><polygon fill="#181818" points="568,942.7109,558,946.7109,568,950.7109,564,946.7109" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="558" x2="605" y1="965.8438" y2="965.8438"/><line style="stroke:#181818;stroke-width:1.0;" x1="605" x2="605" y1="965.8438" y2="978.8438"/><line style="stroke:#181818;stroke-width:1.0;" x1="564" x2="605" y1="978.8438" y2="978.8438"/><polygon fill="#181818" points="574,974.8438,564,978.8438,574,982.8438,570,978.8438" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="193" x="570" y="960.7778">zygoteSendArgsAndGetResult</text><polygon fill="#181818" points="941,1008.9766,951,1012.9766,941,1016.9766,945,1012.9766" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="563" x2="947" y1="1012.9766" y2="1012.9766"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="167" x="570" y="1007.9106">(BufferedWriter)write(arg)</text><polygon fill="#181818" points="1538.5,1038.1094,1548.5,1042.1094,1538.5,1046.1094,1542.5,1042.1094" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="953" x2="1544.5" y1="1042.1094" y2="1042.1094"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="75" x="960" y="1037.0435">read socket</text><polygon fill="#181818" points="1713.5,1067.2422,1723.5,1071.2422,1713.5,1075.2422,1717.5,1071.2422" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1560.5" x2="1719.5" y1="1071.2422" y2="1071.2422"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="54" x="1567.5" y="1066.1763">runOnce</text><polygon fill="#181818" points="1913.5,1096.375,1923.5,1100.375,1913.5,1104.375,1917.5,1100.375" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1735.5" x2="1919.5" y1="1100.375" y2="1100.375"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="113" x="1742.5" y="1095.3091">forkAndSpecialize</text><polygon fill="#181818" points="1746.5,1125.5078,1736.5,1129.5078,1746.5,1133.5078,1742.5,1129.5078" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1740.5" x2="1929.5" y1="1129.5078" y2="1129.5078"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="19" x="1752.5" y="1124.4419">pid</text><line style="stroke:#181818;stroke-width:1.0;" x1="1735.5" x2="1782.5" y1="1153.6406" y2="1153.6406"/><line style="stroke:#181818;stroke-width:1.0;" x1="1782.5" x2="1782.5" y1="1153.6406" y2="1166.6406"/><line style="stroke:#181818;stroke-width:1.0;" x1="1741.5" x2="1782.5" y1="1166.6406" y2="1166.6406"/><polygon fill="#181818" points="1751.5,1162.6406,1741.5,1166.6406,1751.5,1170.6406,1747.5,1166.6406" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="176" x="1747.5" y="1148.5747">if (pid&gt;0) handleParentProc</text><polygon fill="#181818" points="964,1196.7734,954,1200.7734,964,1204.7734,960,1200.7734" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="958" x2="1729.5" y1="1200.7734" y2="1200.7734"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="55" x="970" y="1195.7075">write pid</text><polygon fill="#181818" points="574,1225.9063,564,1229.9063,574,1233.9063,570,1229.9063" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="568" x2="952" y1="1229.9063" y2="1229.9063"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="52" x="580" y="1224.8403">read pid</text><polygon fill="#181818" points="366,1255.0391,356,1259.0391,366,1263.0391,362,1259.0391" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="360" x2="547" y1="1259.0391" y2="1259.0391"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="164" x="372" y="1253.9731">return ProcessStartResult</text><polygon fill="#181818" points="168,1284.1719,158,1288.1719,168,1292.1719,164,1288.1719" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="349" y1="1288.1719" y2="1288.1719"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="164" x="174" y="1283.106">return ProcessStartResult</text><line style="stroke:#181818;stroke-width:1.0;" x1="1730.5" x2="1777.5" y1="1312.3047" y2="1312.3047"/><line style="stroke:#181818;stroke-width:1.0;" x1="1777.5" x2="1777.5" y1="1312.3047" y2="1325.3047"/><line style="stroke:#181818;stroke-width:1.0;" x1="1736.5" x2="1777.5" y1="1325.3047" y2="1325.3047"/><polygon fill="#181818" points="1746.5,1321.3047,1736.5,1325.3047,1746.5,1329.3047,1742.5,1325.3047" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="175" x="1742.5" y="1307.2388">if (pid==0) handleChildProc</text><polygon fill="#181818" points="1413.5,1355.4375,1403.5,1359.4375,1413.5,1363.4375,1409.5,1359.4375" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1407.5" x2="1724.5" y1="1359.4375" y2="1359.4375"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="63" x="1419.5" y="1354.3716">zygoteInit</text><line style="stroke:#181818;stroke-width:1.0;" x1="1402.5" x2="1444.5" y1="1388.5703" y2="1388.5703"/><line style="stroke:#181818;stroke-width:1.0;" x1="1444.5" x2="1444.5" y1="1388.5703" y2="1401.5703"/><line style="stroke:#181818;stroke-width:1.0;" x1="1403.5" x2="1444.5" y1="1401.5703" y2="1401.5703"/><polygon fill="#181818" points="1413.5,1397.5703,1403.5,1401.5703,1413.5,1405.5703,1409.5,1401.5703" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="106" x="1409.5" y="1383.5044">nativeZygoteInit</text><polygon fill="#181818" points="2006,1426.7031,2016,1430.7031,2006,1434.7031,2010,1430.7031" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1402.5" x2="2012" y1="1430.7031" y2="1430.7031"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="88" x="1409.5" y="1425.6372">applicationInit</text><line style="stroke:#181818;stroke-width:1.0;" x1="2028" x2="2070" y1="1459.8359" y2="1459.8359"/><line style="stroke:#181818;stroke-width:1.0;" x1="2070" x2="2070" y1="1459.8359" y2="1472.8359"/><line style="stroke:#181818;stroke-width:1.0;" x1="2029" x2="2070" y1="1472.8359" y2="1472.8359"/><polygon fill="#181818" points="2039,1468.8359,2029,1472.8359,2039,1476.8359,2035,1472.8359" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="107" x="2035" y="1454.77">invokeStaticMain</text><line style="stroke:#181818;stroke-width:1.0;" x1="2028" x2="2070" y1="1501.9688" y2="1501.9688"/><line style="stroke:#181818;stroke-width:1.0;" x1="2070" x2="2070" y1="1501.9688" y2="1514.9688"/><line style="stroke:#181818;stroke-width:1.0;" x1="2029" x2="2070" y1="1514.9688" y2="1514.9688"/><polygon fill="#181818" points="2039,1510.9688,2029,1514.9688,2039,1518.9688,2035,1514.9688" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="236" x="2035" y="1496.9028">throws Zygote.MethodAndArgsCaller</text><polygon fill="#181818" points="1413.5,1540.1016,1403.5,1544.1016,1413.5,1548.1016,1409.5,1544.1016" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="1407.5" x2="2022" y1="1544.1016" y2="1544.1016"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="148" x="1419.5" y="1539.0356">main() catch Exception</text><polygon fill="#181818" points="1085,1569.2344,1075,1573.2344,1085,1577.2344,1081,1573.2344" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1079" x2="1391.5" y1="1573.2344" y2="1573.2344"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="32" x="1091" y="1568.1685">main</text><line style="stroke:#181818;stroke-width:1.0;" x1="1074" x2="1116" y1="1602.3672" y2="1602.3672"/><line style="stroke:#181818;stroke-width:1.0;" x1="1116" x2="1116" y1="1602.3672" y2="1615.3672"/><line style="stroke:#181818;stroke-width:1.0;" x1="1075" x2="1116" y1="1615.3672" y2="1615.3672"/><polygon fill="#181818" points="1085,1611.3672,1075,1615.3672,1085,1619.3672,1081,1615.3672" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="181" x="1081" y="1597.3013">Looper.prepareMainLooper()</text><line style="stroke:#181818;stroke-width:1.0;" x1="1074" x2="1121" y1="1639.5" y2="1639.5"/><line style="stroke:#181818;stroke-width:1.0;" x1="1121" x2="1121" y1="1639.5" y2="1652.5"/><line style="stroke:#181818;stroke-width:1.0;" x1="1080" x2="1121" y1="1652.5" y2="1652.5"/><polygon fill="#181818" points="1090,1648.5,1080,1652.5,1090,1656.5,1086,1652.5" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="134" x="1086" y="1634.4341">new ActivityThread()</text><polygon fill="#181818" points="1183.5,1667.5,1193.5,1671.5,1183.5,1675.5,1187.5,1671.5" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="1079" x2="1189.5" y1="1671.5" y2="1671.5"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="147" x="1195.5" y="1665.5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="133" x="1202.5" y="1685.4951">ApplicationThread</text><line style="stroke:#181818;stroke-width:1.0;" x1="1079" x2="1126" y1="1722.9297" y2="1722.9297"/><line style="stroke:#181818;stroke-width:1.0;" x1="1126" x2="1126" y1="1722.9297" y2="1735.9297"/><line style="stroke:#181818;stroke-width:1.0;" x1="1085" x2="1126" y1="1735.9297" y2="1735.9297"/><polygon fill="#181818" points="1095,1731.9297,1085,1735.9297,1095,1739.9297,1091,1735.9297" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="169" x="1091" y="1717.8638">attach(IApplicationThread)</text><polygon fill="#181818" points="173,1766.0625,163,1770.0625,173,1774.0625,169,1770.0625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="167" x2="1073" y1="1770.0625" y2="1770.0625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="111" x="179" y="1764.9966">attachApplication</text><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="204" y1="1799.1953" y2="1799.1953"/><line style="stroke:#181818;stroke-width:1.0;" x1="204" x2="204" y1="1799.1953" y2="1812.1953"/><line style="stroke:#181818;stroke-width:1.0;" x1="163" x2="204" y1="1812.1953" y2="1812.1953"/><polygon fill="#181818" points="173,1808.1953,163,1812.1953,173,1816.1953,169,1812.1953" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="136" x="169" y="1794.1294">Binder.getCallingPid()</text><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="204" y1="1841.3281" y2="1841.3281"/><line style="stroke:#181818;stroke-width:1.0;" x1="204" x2="204" y1="1841.3281" y2="1854.3281"/><line style="stroke:#181818;stroke-width:1.0;" x1="163" x2="204" y1="1854.3281" y2="1854.3281"/><polygon fill="#181818" points="173,1850.3281,163,1854.3281,173,1858.3281,169,1854.3281" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="156" x="169" y="1836.2622">attachApplicationLocked</text><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="204" y1="1883.4609" y2="1883.4609"/><line style="stroke:#181818;stroke-width:1.0;" x1="204" x2="204" y1="1883.4609" y2="1896.4609"/><line style="stroke:#181818;stroke-width:1.0;" x1="163" x2="204" y1="1896.4609" y2="1896.4609"/><polygon fill="#181818" points="173,1892.4609,163,1896.4609,173,1900.4609,169,1896.4609" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="166" x="169" y="1878.395">find ProcessRecord by pid</text><polygon fill="#181818" points="1257,1921.5938,1267,1925.5938,1257,1929.5938,1261,1925.5938" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="162" x2="1263" y1="1925.5938" y2="1925.5938"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="97" x="169" y="1920.5278">bindApplication</text><polygon fill="#181818" points="1057,1935.5938,1067,1939.5938,1057,1943.5938,1061,1939.5938" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="157" x2="1063" y1="1939.5938" y2="1939.5938"/><line style="stroke:#181818;stroke-width:1.0;" x1="1079" x2="1121" y1="1968.7266" y2="1968.7266"/><line style="stroke:#181818;stroke-width:1.0;" x1="1121" x2="1121" y1="1968.7266" y2="1981.7266"/><line style="stroke:#181818;stroke-width:1.0;" x1="1080" x2="1121" y1="1981.7266" y2="1981.7266"/><polygon fill="#181818" points="1090,1977.7266,1080,1981.7266,1090,1985.7266,1086,1981.7266" style="stroke:#181818;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="85" x="1086" y="1963.6606">Looper.loop()</text><!--SRC=[bLR9Rjim4BthAtYBd216qlPa804SeoW2P37YeWNI4qEEBI8oAL1qdEHOjEUU-WNzWTxxFLq-eqEAacbhiNEIFVDcuUCit2E9u42cIfaxzHXbL1l1H4Qb8RTFCsNWN0f3bEQWoV7HKGDW0le1bINak04oKb82CqB92lQg0LOfNwyfRnRIYFbw8c-YJ-hmD4nnGEPKo2YGL7gVuVv-btP0DCn4Ra0NWebYzs2YDKpTHiAIN2X6qz0excq9j90JI96G2wMoxWW71uXV9YA5sEW5zBRbSvttCvMccC4UdiSij8mAfeP8_uCmJvTKqbbnHi40BNA3L8-rOf3d5pPz7hLWqOl7OLhUC2ebLIfroBgy7VX1q4AppM90_lxwyk_7rsSd_Vtjyv_lFtU9eZAGdYztJ-VJAm2E1swndHYAHMajML70KIX7M77ppjUgkYfj-3Ui58SVSgunM9V7C70ehzT8BS6EOgACGMP6QZwdaey1z0usJ0FcTmNBLIEtM0MTZeJu2kpuX2ILcbskyjb7btoeP_bGydTWRY1Vf0tb5d8t8F7POZe53VoZ5jZilQNzn5JFUfqas_50EScBgS21sXwnbnOORUV4fexTVorPMUI1iZ9miAdIztYkIGPCq5Gyb_IGJF0mVXYpLTuUQoCvCIKn1ZWzwf44woE5CTKWtNneTBBEhUFI9TX8vQf_7PUD1magh4jNk-Jgvw5pxvZoieaTBhuuQZuzfbqHn6YRYzqXNqp-oKd5_WWdFsybFrWogvwmVnlNZz-Iak8XuBOD6ovRwvHcMIeOjI4TEjHlmF40ya7TksOMxD9kuqwqIRHQvZwx_YMOHF5XqT0ZcgPOjfvKkzZZ7i4iM4BUFjhvjQg1qdTvEUyJLrp-ER0XRSBP9Gowdsd0HmVOj0i9xj2jrfOXEzZNnSsMAoAz40VaJW6eCPGbyNdDGrU26pMwyXDuwLZqhS-5Co7n1TQVWR5t9EHiBCBpli1JBPsjhuzMLrDCgcoz6s3uI2HtJsw-T3YhtSU0tA6Va1-_a8BPi4xu2yehnK_S-my0]--></g></svg>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/60405.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/34020.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/34020.html" class="post-title-link" itemprop="url">GraphViz dot</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-26 16:28:39" itemprop="dateCreated datePublished" datetime="2020-11-26T16:28:39+08:00">2020-11-26</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-08 11:12:55" itemprop="dateModified" datetime="2023-10-08T11:12:55+08:00">2023-10-08</time>
    </span>

  
</div>

            <div class="post-description">本文介绍Graphviz dot的常用知识点</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="工具"><a href="#工具" class="headerlink" title="工具"></a>工具</h2><p>在线编译工具：<a target="_blank" rel="noopener external nofollow noreferrer" href="http://viz-js.com/">http://viz-js.com</a><br>VSCode安装插件：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://marketplace.visualstudio.com/items?itemName=joaompinto.vscode-graphviz">Graphviz (dot) language support for Visual Studio Code</a><br>命令行：dot，比如，<code>dot -Tpng -ofile.png file.dot</code>可以导出图片。在Ubuntu系统中，通过<code>sudo apt install graphviz</code>安装即可使用。</p>
<p>添加系统环境变量：</p>
<p>GRAPHVIZ_DOT = D:\Program Files\Graphviz\bin\dot.exe</p>
<h2 id="学习资料"><a href="#学习资料" class="headerlink" title="学习资料"></a>学习资料</h2><p><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/shapes.html">Node Shapes</a><br><a target="_blank" rel="noopener external nofollow noreferrer" href="https://renenyffenegger.ch/notes/tools/Graphviz/examples/index">Graphviz (dot) examples</a><br><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/attrs.html">Node, Edge and Graph Attributes</a></p>
<h2 id="常用属性介绍"><a href="#常用属性介绍" class="headerlink" title="常用属性介绍"></a>常用属性介绍</h2><h3 id="节点（node）属性"><a href="#节点（node）属性" class="headerlink" title="节点（node）属性"></a>节点（node）属性</h3><p>节点的形状主要有三种：<a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/shapes.html#polygon">Polygon-based Nodes</a>, <a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/shapes.html#record">Record-based Nodes</a>, <a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/shapes.html#epsf">User-defined Nodes</a>。点击链接可看到详细介绍。</p>
<table>
<thead>
<tr>
<th>属性名称</th>
<th>介绍</th>
</tr>
</thead>
<tbody><tr>
<td><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/attrs.html#d:shape">shape</a></td>
<td>节点形状，box长方形、circle圆形等，参考<a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/shapes.html">Node Shapes</a></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/attrs.html#k:color">color</a></td>
<td>边框颜色</td>
</tr>
<tr>
<td><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/attrs.html#d:style">style</a></td>
<td>节点样式，filled, invisible, diagonals等，参考<a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/shapes.html#d:style">Styles for Nodes</a></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/attrs.html#d:fillcolor">fillcolor</a></td>
<td>填充颜色, 只有在style=filled时才生效</td>
</tr>
<tr>
<td><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.graphviz.org/doc/info/attrs.html#d:fontcolor">fontcolor</a></td>
<td>文字颜色</td>
</tr>
</tbody></table>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/34020.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/27579.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/27579.html" class="post-title-link" itemprop="url">Hexo User Manual</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-24 18:18:00" itemprop="dateCreated datePublished" datetime="2020-11-24T18:18:00+08:00">2020-11-24</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-09-19 15:02:41" itemprop="dateModified" datetime="2023-09-19T15:02:41+08:00">2023-09-19</time>
    </span>

  
</div>

            <div class="post-description">Hexo博客配置杂记</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="VSCode-Hexo"><a href="#VSCode-Hexo" class="headerlink" title="VSCode + Hexo"></a>VSCode + Hexo</h2><h3 id="安装Paste-Image插件"><a href="#安装Paste-Image插件" class="headerlink" title="安装Paste Image插件"></a>安装<a target="_blank" rel="noopener external nofollow noreferrer" href="https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image">Paste Image</a>插件</h3><p>安装完插件后，通过 <code>Ctrl + Shift + P</code> 快捷键打开setting.json<br><img src="/images/Hexo-User-Manual_2023-08-17-13-48-48.png" alt="Open Settings(JSON)"></p>
<p>然后，在setting.json文件中添加两行配置</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">&quot;pasteImage.path&quot;</span><span class="punctuation">:</span> <span class="string">&quot;$&#123;currentFileNameWithoutExt&#125;/&quot;</span><span class="punctuation">,</span></span><br><span class="line"><span class="attr">&quot;pasteImage.insertPattern&quot;</span><span class="punctuation">:</span> <span class="string">&quot;&#123;% asset_img $&#123;imageFileName&#125; %&#125;&quot;</span><span class="punctuation">,</span></span><br></pre></td></tr></table></figure>

<p>然后就可以使用<code>Ctrl + Alt + V</code>快捷键就可以粘贴图片到markdown文档中了。但是这个快捷键不一定好使。也可以通过<code>Ctrl + Shift + P</code>然后输入<code>past image</code>来粘贴。<br>插入的图片采用<code>asset_img</code>语法，关于asset_img详细信息可参考：<a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io/docs/asset-folders">https://hexo.io/docs/asset-folders</a>。插入的图片将会放到markdown文件同名的文件夹中。</p>
<h3 id="安装Markdown-Preview-Enhanced插件"><a href="#安装Markdown-Preview-Enhanced插件" class="headerlink" title="安装Markdown Preview Enhanced插件"></a>安装<a target="_blank" rel="noopener external nofollow noreferrer" href="https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced">Markdown Preview Enhanced</a>插件</h3><p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced">Markdown Preview Enhanced</a>插件无法展示使用<code>asset_img</code>插入的图片，需要修改插件的<code>parser.js</code>。通过快捷键<code>Ctrl+Shift+P</code>打开<code>parser.js</code>:<br><img src="/images/Hexo-User-Manual_2023-08-17-13-52-11.png" alt="Extent Parser"><br>然后修改onWillParseMarkdown函数：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">onWillParseMarkdown</span>: <span class="keyword">function</span>(<span class="params">markdown</span>) &#123;</span><br><span class="line">  <span class="keyword">var</span> vscode = <span class="built_in">require</span>(<span class="string">&quot;vscode&quot;</span>);</span><br><span class="line">  <span class="keyword">var</span> path = <span class="built_in">require</span>(<span class="string">&quot;path&quot;</span>);</span><br><span class="line">  <span class="keyword">return</span> <span class="keyword">new</span> <span class="title class_">Promise</span>(<span class="function">(<span class="params">resolve, reject</span>)=&gt;</span> &#123;</span><br><span class="line">    markdown = markdown.<span class="title function_">replace</span>(</span><br><span class="line">      <span class="regexp">/\&#123;%\s*asset_img\s*(\S+)\s*\S*\s*%\&#125;/g</span>,</span><br><span class="line">      <span class="function">(<span class="params">whole, content</span>) =&gt;</span> &#123;</span><br><span class="line">        abs_filename = vscode.<span class="property">window</span>.<span class="property">activeTextEditor</span>.<span class="property">document</span>.<span class="property">fileName</span></span><br><span class="line">        filename = path.<span class="title function_">basename</span>(abs_filename);</span><br><span class="line">        filename = filename.<span class="title function_">substring</span>(<span class="number">0</span>,filename.<span class="title function_">indexOf</span>(<span class="string">&#x27;.&#x27;</span>))</span><br><span class="line">        <span class="keyword">return</span> <span class="string">`![](<span class="subst">$&#123;filename + <span class="string">&quot;/&quot;</span>+ content&#125;</span>)`</span>;</span><br><span class="line">      &#125;</span><br><span class="line">    )</span><br><span class="line">    <span class="keyword">return</span> <span class="title function_">resolve</span>(markdown)</span><br><span class="line">  &#125;)</span><br><span class="line">&#125;,</span><br></pre></td></tr></table></figure>

<p>参考文章：</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/27579.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/27252.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/27252.html" class="post-title-link" itemprop="url">Android binder剖析之addService</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-23 11:16:04" itemprop="dateCreated datePublished" datetime="2020-11-23T11:16:04+08:00">2020-11-23</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>本文基于Android 8.0源码分析。以mediaserver为例剖析binder addService的流程。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/27252.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/31280.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/31280.html" class="post-title-link" itemprop="url">Android Java虚拟机创建过程</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-10-30 00:00:00" itemprop="dateCreated datePublished" datetime="2020-10-30T00:00:00+08:00">2020-10-30</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">基于Android8.0分析Java虚拟机创建过程</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p>本文基于Android8.0源码</p>
<p>Android8.0使用的java虚拟机为ART，在大名鼎鼎的zygote进程中启动java虚拟机。<br>首先看一下zygote的main函数：</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//app_main.cpp</span></span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">(<span class="type">int</span> argc, <span class="type">char</span>* <span class="type">const</span> argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="comment">//AppRuntime继承自AndroidRuntime, 构造函数中没有什么有用信息，可以不关注</span></span><br><span class="line">    <span class="function">AppRuntime <span class="title">runtime</span><span class="params">(argv[<span class="number">0</span>], computeArgBlockSize(argc, argv))</span></span>;</span><br><span class="line">    <span class="comment">//...</span></span><br><span class="line">    <span class="keyword">if</span> (zygote) &#123;</span><br><span class="line">        <span class="comment">//调用到AndroidRuntime.start函数启动zygote进程的虚拟机</span></span><br><span class="line">        <span class="comment">//传入的第一个参数是java类ZygoteInit</span></span><br><span class="line">        runtime.<span class="built_in">start</span>(<span class="string">&quot;com.android.internal.os.ZygoteInit&quot;</span>, args, zygote);</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (className) &#123;</span><br><span class="line">        runtime.<span class="built_in">start</span>(<span class="string">&quot;com.android.internal.os.RuntimeInit&quot;</span>, args, zygote);</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="built_in">fprintf</span>(stderr, <span class="string">&quot;Error: no class name or --zygote supplied.\n&quot;</span>);</span><br><span class="line">        <span class="built_in">app_usage</span>();</span><br><span class="line">        <span class="built_in">LOG_ALWAYS_FATAL</span>(<span class="string">&quot;app_process: no class name or --zygote supplied.&quot;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>runtime.start会调用父类的AndroidRuntime::start，看一下实现</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//AndroidRuntime.cpp</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">AndroidRuntime::start</span><span class="params">(<span class="type">const</span> <span class="type">char</span>* className, <span class="type">const</span> Vector&lt;String8&gt;&amp; options, <span class="type">bool</span> zygote)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    ......</span><br><span class="line">    <span class="comment">/* start the virtual machine */</span></span><br><span class="line">    JniInvocation jni_invocation;</span><br><span class="line">    jni_invocation.<span class="built_in">Init</span>(<span class="literal">NULL</span>);  <span class="comment">// 1. 加载虚拟机动态库，并加载库函数符号</span></span><br><span class="line">    JNIEnv* env;</span><br><span class="line">    <span class="keyword">if</span> (<span class="built_in">startVm</span>(&amp;mJavaVM, &amp;env, zygote) != <span class="number">0</span>) &#123; <span class="comment">// 2. 启动虚拟机</span></span><br><span class="line">        <span class="keyword">return</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="built_in">onVmCreated</span>(env);</span><br><span class="line"></span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">     * Register android functions.</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="keyword">if</span> (<span class="built_in">startReg</span>(env) &lt; <span class="number">0</span>) &#123;</span><br><span class="line">        <span class="built_in">ALOGE</span>(<span class="string">&quot;Unable to register all android natives\n&quot;</span>);</span><br><span class="line">        <span class="keyword">return</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    ......</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (startClass == <span class="literal">NULL</span>) &#123;</span><br><span class="line">        <span class="built_in">ALOGE</span>(<span class="string">&quot;JavaVM unable to locate class &#x27;%s&#x27;\n&quot;</span>, slashClassName);</span><br><span class="line">        <span class="comment">/* keep going */</span></span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="comment">//调用com.android.internal.os.ZygoteInit的main函数，从此便进入了Java的世界</span></span><br><span class="line">        jmethodID startMeth = env-&gt;<span class="built_in">GetStaticMethodID</span>(startClass, <span class="string">&quot;main&quot;</span>,</span><br><span class="line">            <span class="string">&quot;([Ljava/lang/String;)V&quot;</span>);</span><br><span class="line">        <span class="keyword">if</span> (startMeth == <span class="literal">NULL</span>) &#123;</span><br><span class="line">            <span class="built_in">ALOGE</span>(<span class="string">&quot;JavaVM unable to find main() in &#x27;%s&#x27;\n&quot;</span>, className);</span><br><span class="line">            <span class="comment">/* keep going */</span></span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            env-&gt;<span class="built_in">CallStaticVoidMethod</span>(startClass, startMeth, strArray);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ol>
<li>加载虚拟机动态库，并加载库函数符号</li>
</ol>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//JniInvocation.cpp</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">bool</span> <span class="title">JniInvocation::Init</span><span class="params">(<span class="type">const</span> <span class="type">char</span>* library)</span> </span>&#123;</span><br><span class="line">  ......</span><br><span class="line">  library = <span class="built_in">GetLibrary</span>(library, buffer); <span class="comment">//返回“libart.so” art虚拟机库</span></span><br><span class="line">  ......</span><br><span class="line">  handle_ = <span class="built_in">dlopen</span>(library, kDlopenFlags);  <span class="comment">//动态加载虚拟机so库</span></span><br><span class="line">  ......</span><br><span class="line">  <span class="comment">//下面的三个if语句都是通过dlsym来获取虚拟机so库中的函数符号</span></span><br><span class="line">  <span class="keyword">if</span> (!<span class="built_in">FindSymbol</span>(<span class="built_in">reinterpret_cast</span>&lt;<span class="type">void</span>**&gt;(&amp;JNI_GetDefaultJavaVMInitArgs_),</span><br><span class="line">                  <span class="string">&quot;JNI_GetDefaultJavaVMInitArgs&quot;</span>)) &#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="comment">//无比重要的函数，获取虚拟机构造函数的函数符号，创建虚拟机全靠JNI_CreateJavaVM</span></span><br><span class="line">  <span class="keyword">if</span> (!<span class="built_in">FindSymbol</span>(<span class="built_in">reinterpret_cast</span>&lt;<span class="type">void</span>**&gt;(&amp;JNI_CreateJavaVM_),</span><br><span class="line">                  <span class="string">&quot;JNI_CreateJavaVM&quot;</span>)) &#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">if</span> (!<span class="built_in">FindSymbol</span>(<span class="built_in">reinterpret_cast</span>&lt;<span class="type">void</span>**&gt;(&amp;JNI_GetCreatedJavaVMs_),</span><br><span class="line">                  <span class="string">&quot;JNI_GetCreatedJavaVMs&quot;</span>)) &#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line">  &#125;</span><br><span class="line">  <span class="keyword">return</span> <span class="literal">true</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function">jint <span class="title">JniInvocation::JNI_CreateJavaVM</span><span class="params">(JavaVM** p_vm, JNIEnv** p_env, <span class="type">void</span>* vm_args)</span> </span>&#123;</span><br><span class="line">  <span class="keyword">return</span> <span class="built_in">JNI_CreateJavaVM_</span>(p_vm, p_env, vm_args);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">//该函数就是最终创建虚拟机的函数</span></span><br><span class="line"><span class="keyword">extern</span> <span class="string">&quot;C&quot;</span> <span class="function">jint <span class="title">JNI_CreateJavaVM</span><span class="params">(JavaVM** p_vm, JNIEnv** p_env, <span class="type">void</span>* vm_args)</span> </span>&#123;</span><br><span class="line">  <span class="keyword">return</span> JniInvocation::<span class="built_in">GetJniInvocation</span>().<span class="built_in">JNI_CreateJavaVM</span>(p_vm, p_env, vm_args);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ol start="2">
<li>启动虚拟机</li>
</ol>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment"> * Start the Dalvik Virtual Machine.</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">AndroidRuntime::startVm</span><span class="params">(JavaVM** pJavaVM, JNIEnv** pEnv, <span class="type">bool</span> zygote)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    ...... <span class="comment">//组装虚拟机启动参数</span></span><br><span class="line">    <span class="comment">/*</span></span><br><span class="line"><span class="comment">     * Initialize the VM.</span></span><br><span class="line"><span class="comment">     *</span></span><br><span class="line"><span class="comment">     * The JavaVM* is essentially per-process, and the JNIEnv* is per-thread.</span></span><br><span class="line"><span class="comment">     * If this call succeeds, the VM is ready, and we can start issuing</span></span><br><span class="line"><span class="comment">     * JNI calls.</span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="keyword">if</span> (<span class="built_in">JNI_CreateJavaVM</span>(pJavaVM, pEnv, &amp;initArgs) &lt; <span class="number">0</span>) &#123;</span><br><span class="line">        <span class="built_in">ALOGE</span>(<span class="string">&quot;JNI_CreateJavaVM failed\n&quot;</span>);</span><br><span class="line">        <span class="keyword">return</span> <span class="number">-1</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/31280.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/56256.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/56256.html" class="post-title-link" itemprop="url">软件设计原则</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-09-04 00:00:00" itemprop="dateCreated datePublished" datetime="2019-09-04T00:00:00+08:00">2019-09-04</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>

  
</div>

            <div class="post-description">SOLID和GRASP软件编程原则介绍</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h3 id="SOLID"><a href="#SOLID" class="headerlink" title="SOLID"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://en.wikipedia.org/wiki/SOLID">SOLID</a></h3><hr>
<h4 id="Single-responsibility-principle-单一职责"><a href="#Single-responsibility-principle-单一职责" class="headerlink" title="Single responsibility principle 单一职责"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://en.wikipedia.org/wiki/Single_responsibility_principle">Single responsibility principle</a> 单一职责</h4><p>The single responsibility principle is a computer programming principle that states that every module, class, or function should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class, module or function. All its services should be narrowly aligned with that responsibility. Robert C. Martin expresses the principle as, “A class should have only one reason to change,” although, because of confusion around the word “reason” he more recently stated “This principle is about people.(Actor)”</p>
<p>Martin defines a responsibility as a reason to change, and concludes that a class or module should have one, and only one, reason to be changed (i.e. rewritten). As an example, consider a module that compiles and prints a report. Imagine such a module can be changed for two reasons. First, the content of the report could change. Second, the format of the report could change. These two things change for very different causes; one substantive, and one cosmetic. The single responsibility principle says that these two aspects of the problem are really two separate responsibilities, and should therefore be in separate classes or modules. It would be a bad design to couple two things that change for different reasons at different times.</p>
<p>The reason it is important to keep a class focused on a single concern is that it makes the class more robust. Continuing with the foregoing example, if there is a change to the report compilation process, there is greater danger that the printing code will break if it is part of the same class.</p>
<h4 id="Open–closed-principle-开闭原则"><a href="#Open–closed-principle-开闭原则" class="headerlink" title="Open–closed principle 开闭原则"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle">Open–closed principle</a> 开闭原则</h4><p>Open/closed principle states “software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification”; that is, such an entity can allow its behaviour to be extended without modifying its source code.</p>
<p>The name open/closed principle has been used in two ways. Both ways use generalizations (for instance, inheritance or delegate functions) to resolve the apparent dilemma, but the goals, techniques, and results are different.</p>
<h4 id="Liskov-substitution-principle-里式替换"><a href="#Liskov-substitution-principle-里式替换" class="headerlink" title="Liskov substitution principle 里式替换"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://en.wikipedia.org/wiki/Liskov_substitution_principle">Liskov substitution principle</a> 里式替换</h4>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/56256.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/24313.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/24313.html" class="post-title-link" itemprop="url">APK 反编译</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-05-10 00:00:00" itemprop="dateCreated datePublished" datetime="2019-05-10T00:00:00+08:00">2019-05-10</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-20 10:04:04" itemprop="dateModified" datetime="2023-10-20T10:04:04+08:00">2023-10-20</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">Android APK反编译工具使用介绍</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="使用的工具"><a href="#使用的工具" class="headerlink" title="使用的工具"></a>使用的工具</h2><ul>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://ibotpeaches.github.io/Apktool/">apktool</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/pxb1988/dex2jar">dex2jar</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/java-decompiler/jd-gui">JD-GUI</a></li>
</ul>
<h2 id="dex转换为jar"><a href="#dex转换为jar" class="headerlink" title="dex转换为jar"></a>dex转换为jar</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">d2j-dex2jar.sh -f ~/path/to/apk_to_decompile.apk</span><br></pre></td></tr></table></figure>

<p>生成jar包后，需要使用<a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/java-decompiler/jd-gui">JD-GUI</a>打开查看</p>
<p>在macos上打开JD-GUI可能会报下面错误：</p>
<figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">No suitable Java version found on your system!</span><br><span class="line">This program requires Java 1.8+</span><br><span class="line">Make sure you install the required Java version.</span><br></pre></td></tr></table></figure>

<p>解决方案：在JD-GUI应用程序右击，然后选择“显示包内容”，然后打开<code>Contents/MacOS/universalJavaApplicationStub.sh</code>文件，找到这个报错的打印位置，把JAVA_HOME赋值为jdk home路径即可。</p>
<h2 id="反编译为Smali"><a href="#反编译为Smali" class="headerlink" title="反编译为Smali"></a>反编译为Smali</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -jar apktool_2.8.1.jar decode -o apk_smali app.apk</span><br></pre></td></tr></table></figure>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/24313.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/52098.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/52098.html" class="post-title-link" itemprop="url">Mixin模式</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-01-13 00:00:00" itemprop="dateCreated datePublished" datetime="2019-01-13T00:00:00+08:00">2019-01-13</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">设计模式</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">Mixin设计模式</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://en.wikipedia.org/wiki/Mixin">Mixin wiki</a></p>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.cnblogs.com/xybaby/p/6484262.html">Mixin模式</a></p>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/52098.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/2892.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/2892.html" class="post-title-link" itemprop="url">Git 中文乱码问题</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2019-01-13 00:00:00" itemprop="dateCreated datePublished" datetime="2019-01-13T00:00:00+08:00">2019-01-13</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86/" itemprop="url" rel="index"><span itemprop="name">代码管理</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">待整理...</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h2 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h2><p><a target="_blank" rel="noopener external nofollow noreferrer" href="http://www.worldhello.net/gotgit/08-git-misc/020-git-charset.html">Git字符集问题</a></p>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/2892.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://rjyblog.gitee.io/posts/45980.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Jason">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="任建勇的博客">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="undefined | 任建勇的博客">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/posts/45980.html" class="post-title-link" itemprop="url">ANR分析</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-09-05 00:00:00" itemprop="dateCreated datePublished" datetime="2018-09-05T00:00:00+08:00">2018-09-05</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-08-17 09:46:48" itemprop="dateModified" datetime="2023-08-17T09:46:48+08:00">2023-08-17</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Android/" itemprop="url" rel="index"><span itemprop="name">Android</span></a>
        </span>
    </span>

  
</div>

            <div class="post-description">Android anr分析笔记</div>
        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h1><ul>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="https://developer.android.com/topic/performance/vitals/anr">ANRs (Google)</a></li>
<li><a target="_blank" rel="noopener external nofollow noreferrer" href="http://zenandroid.io/deadlocks-and-anrs/">Deadlocks and ANRs</a></li>
</ul>

          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/posts/45980.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




  <nav class="pagination">
    <a class="extend prev" rel="prev" title="上一页" aria-label="上一页" href="/page/4/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/">4</a><span class="page-number current">5</span><a class="page-number" href="/page/6/">6</a><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" title="下一页" aria-label="下一页" href="/page/6/"><i class="fa fa-angle-right"></i></a>
  </nav>

</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2024</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">Jason</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener external nofollow noreferrer" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener external nofollow noreferrer" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.24/fancybox/fancybox.umd.js" integrity="sha256-oyhjPiYRWGXaAt+ny/mTMWOnN1GBoZDUQnzzgC7FRI4=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>


  <script class="next-config" data-name="mermaid" type="application/json">{"enable":true,"theme":{"light":"default","dark":"dark"},"js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.5.0/mermaid.min.js","integrity":"sha256-K7oJiQlDulzl24ZUFOywuYme1JqBBvQzK6m8qHjt9Gk="}}</script>
  <script type="module" src="/js/zenuml-definition-074a43fa.js"></script>
  <script type="module" src="/js/mermaid-zenuml.esm.min.mjs"></script>
  <script src="/js/third-party/tags/mermaid.js"></script>


  <script src="/js/third-party/fancybox.js"></script>



  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>



</body>
</html>
